package com.iman.Confucius.mappers;

import com.iman.Confucius.mappers.models.DrmCourseCategory;
import com.iman.Confucius.mappers.models.DrmCourseCategoryExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmCourseCategoryMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int countByExample(DrmCourseCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int deleteByExample(DrmCourseCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Delete({
        "delete from drm_course_category",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Insert({
        "insert into drm_course_category (id, category_name, ",
        "category_tp, icon_class, ",
        "is_pause, create_time, ",
        "create_user, modify_time, ",
        "modify_user, delete_flag, ",
        "category_sourceid, category_times)",
        "values (#{id,jdbcType=BIGINT}, #{categoryName,jdbcType=VARCHAR}, ",
        "#{categoryTp,jdbcType=INTEGER}, #{iconClass,jdbcType=VARCHAR}, ",
        "#{isPause,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{createUser,jdbcType=BIGINT}, #{modifyTime,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{modifyUser,jdbcType=BIGINT}, #{deleteFlag,jdbcType=INTEGER}, ",
        "#{categorySourceid,jdbcType=VARCHAR}, #{categoryTimes,jdbcType=INTEGER})"
    })
    int insert(DrmCourseCategory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int insertSelective(DrmCourseCategory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    List<DrmCourseCategory> selectByExample(DrmCourseCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Select({
        "select",
        "id, category_name, category_tp, icon_class, is_pause, create_time, create_user, ",
        "modify_time, modify_user, delete_flag, category_sourceid, category_times",
        "from drm_course_category",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmCourseCategory selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmCourseCategory record, @Param("example") DrmCourseCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByExample(@Param("record") DrmCourseCategory record, @Param("example") DrmCourseCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByPrimaryKeySelective(DrmCourseCategory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_category
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Update({
        "update drm_course_category",
        "set category_name = #{categoryName,jdbcType=VARCHAR},",
          "category_tp = #{categoryTp,jdbcType=INTEGER},",
          "icon_class = #{iconClass,jdbcType=VARCHAR},",
          "is_pause = #{isPause,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "create_user = #{createUser,jdbcType=BIGINT},",
          "modify_time = #{modifyTime,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "modify_user = #{modifyUser,jdbcType=BIGINT},",
          "delete_flag = #{deleteFlag,jdbcType=INTEGER},",
          "category_sourceid = #{categorySourceid,jdbcType=VARCHAR},",
          "category_times = #{categoryTimes,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmCourseCategory record);
}